package com.ws.ssmzongjie3.mapper;

import com.ws.ssmzongjie3.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    @Insert("insert into user(u_name,u_pass,u_sex,u_email,u_avatar,u_phone,u_birthday,register_time) values(#{u_name},#{u_pass},#{u_sex},#{u_email},#{u_avatar},#{u_phone},#{u_birthday},now())")
    public void insertUser(User user);
    @Delete("delete from user where user_id=#{user_id}")
    public void deleteUser(User user);
    @Select("select * from user where user_id=#{user_id}")
    public User getUserById(User user);
    @Select("select * from user where u_name=#{u_name} and u_pass=#{u_pass}")
    public User getLogin(User user);
    @Select("select * from user where u_name=#{u_name}")
    public User getUserByName(User user);
    public void updateUser(User user);
    public List<User> listUser(User user);
}
